package dao.inter;

import java.io.Serializable;
import java.util.List;

import dao.hibernate.MiniDaoConstants;
import first.guodao.annotation.DaoType;
import first.guodao.annotation.Guodao;
import first.guodao.annotation.Methodtype;

@Guodao
public interface UserMybatisDao<T> {
	@Methodtype(value = DaoType.Mybatis, methodname = "save")
	void save(T entity);

	@Methodtype(value = DaoType.Mybatis, methodname = MiniDaoConstants.METHOD_GET_BY_ID)
	<T> T getById(Class<T> entityClass, final Serializable id);

	@Methodtype(value = DaoType.Mybatis, methodname = MiniDaoConstants.METHOD_GET_BY_ENTITY)
	<T> T getByEntity(T entity);

	@Methodtype(value = DaoType.Mybatis, methodname = "update")
	void update(T entity);

	@Methodtype(value = DaoType.Mybatis, methodname = "delete")
	void delete(T entity);

	@Methodtype(value = DaoType.Mybatis, methodname = MiniDaoConstants.METHOD_DELETE_BY_ID)
	public <T> void deleteById(Class entityName, Serializable id);

	@Methodtype(value = DaoType.Mybatis, methodname = "select")
	List<T> list(T entity);

}
